<template>
  <el-row :gutter="20">
    <el-col :span="4"><div class="grid-content ep-bg-purple" /></el-col>
    <el-col :span="16"
      ><div class="grid-content ep-bg-purple tabs_scroll channel_list">
        <span
          class="channel_item"
          @click="toTargetRoute('Recommend')"
          :class="isActive === 0 ? 'active' : ''"
          >推荐</span
        >
        <span
          class="channel_item"
          @click="toTargetRoute('Original')"
          :class="isActive === 1 ? 'active' : ''"
          >作品</span
        >
        <span
          class="channel_item"
          @click="toTargetRoute('Course')"
          :class="isActive === 2 ? 'active' : ''"
          >教程</span
        >
        <span
          class="channel_item"
          @click="toTargetRoute('SpecialTopic')"
          :class="isActive === 3 ? 'active' : ''"
          >专题</span
        >
        <span
          class="channel_item"
          @click="toTargetRoute('Information')"
          :class="isActive === 4 ? 'active' : ''"
          >动态</span
        >
        <span
          class="channel_item"
          @click="toTargetRoute('Attention')"
          :class="isActive === 5 ? 'active' : ''"
          >关注</span
        >
        <span
          class="channel_item"
          v-for="item in scrollAttrListCopy"
          :key="item.id"
          @click="toTargetRoute('Index', item.id)"
          :class="isActive === item.id ? 'active' : ''"
          >{{ item.name }}</span
        >
      </div>
    </el-col>
    <el-col :span="4"
      ><div class="grid-content ep-bg-purple">
        <span class="channel_items" @click="showDialog">
          <ele-Grid></ele-Grid>请选择兴趣标签</span
        >
      </div>
    </el-col>
  </el-row>
  <!-- 选择兴趣弹窗 -->
  <InterestDialog></InterestDialog>
</template>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "Tabs",
});
</script>
<script lang="ts" setup>
import { storeToRefs } from "pinia";
import useTabsState from "./hooks/indnx";
import useInterestDialogState from "@/views/Index/components/InterestDialog/hooks";
const InterestDialogState = useInterestDialogState();
const { showDialog } = InterestDialogState;
const { scrollAttrListCopy } = storeToRefs(InterestDialogState);
const tabsState = useTabsState();
const { isActive, toTargetRoute } = tabsState;
</script>
<style scoped lang="scss">
.el-row {
  margin-bottom: 20px;
  padding: 10px;
}
.el-row:last-child {
  margin-bottom: 0;
}
.el-col {
  border-radius: 4px;
  .grid-content {
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    .channel_item {
      padding: 20px 4px;
      margin: 0 20px;
      font-size: 19px;
      font-weight: 500;
      color: #999;
      cursor: pointer;
    }
    .channel_items {
      padding: 20px 4px;
      margin: 0 20px;
      font-size: 19px;
      font-weight: 500;
      color: #333;
      cursor: pointer;
    }
    .channel_item:hover {
      color: #333;
    }
    svg {
      height: 20px;
      width: 20px;
      vertical-align: middle;
    }
    .active {
      color: #333;
      border-bottom: 3px solid #333;
    }
  }
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
</style>
